﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Aj.Core;
using System.Data;

public partial class rfsociety_lanmu : PageBase
{
    protected string name = "";

    protected string title = "";
    protected string content = "";
    protected DataSet ds = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            name = QueryParam("n");
            if (name.IsNotNullAndEmpty())
            {
                string key = "/cache/rfsocietylanmu/" + name;
                if (Function.GetCacheObject(key) == null)
                {
                    ds = CustomQuery.LanMuInfo_GetLanMuInfoByUrlName(name);
                    if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                    {
                        title = ds.Tables[0].Rows[0]["LM_Name"].ToString();
                        content = ds.Tables[0].Rows[0]["LM_Content"].ToString();
                        Function.AddCacheObject(key, ds, DateTime.Now.AddHours(12));
                    }
                    else
                    {
                        Page_GoTo("rfsociety.html");
                    }
                }
                else
                {
                    ds = Function.GetCacheObject(key) as DataSet;
                    if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                    {
                        title = ds.Tables[0].Rows[0]["LM_Name"].ToString();
                        content = ds.Tables[0].Rows[0]["LM_Content"].ToString();
                    }
                    else
                    {
                        Page_GoTo("rfsociety.html");
                    }
                }
            }
            else
            {
                Page_GoTo("rfsociety.html");
            }
        }
        catch (Exception ex)
        {
            Function.WriteErrorLog(ex);
        }
    }
}